#!/bin/bash
##################################################################
## function: compress log 
## eg：./log_compress.sh
## author: shx
## createdate: 20150908 
## version:     
################################################################## 
. /home/hadoop/shx/baseUtil.sh


if [[ ! -n "$1" ]] && [[ ! -n "$2" ]] ;then
	HISTORYDATE=`date -d '-1 hours'  +%Y%m%d`
	HOUR=`date -d '-1 hours' +%H`
else
	HISTORYDATE=$1
	HOUR=$2
fi

startDate="20150610"
endDate="20150831"

#获取时间循环列表
startSec=`date -d "$startDate" "+%s"`
endSec=`date -d "$endDate" "+%s"`

for((i=startSec;i<=endSec;i+=86400)); do
    curdate=`date -d "@$i" "+%Y%m%d"`
    echo $curdate


    /usr/local/cloud/hadoop/bin/hadoop jar  qyer_compress.jar /flume/original/nobita/$curdate/*/*  /flume/originalcompress/nobita/$curdate/
done

if [ $? -eq 0 ]
  then
  	echo `date`"=============== nobita log compress is ok  end===============" 
else
  	echo `date`"================nobita log compress is error end !================" 
  	mailSend "127 :nobita log compress is error end !"
fi








